<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="Author" content="">
    <meta content="" name="design">
    <title>新房</title>
    <link rel="stylesheet" href="${s.base}/site/css/css.css"/>
    <link rel="stylesheet" type="text/css" href="${s.base}/site/css/style.css"/>
	<link rel="stylesheet" type="text/css" href="${s.base}/site/js/jquery.sPage.css"/>
    <script type="text/javascript" src="${s.base}/site/js/jquery-1.9.1.min.js"></script>
	<script type="text/javascript" src="${s.base}/site/js/jquery.sPage.js"></script>
</head>
<style>
	body,html{
		background: #fff;
		padding-top: 25px;
	}
	#myPage{
		margin: 30px 0px;
		text-align: center;
	}
	.spage-number span.active,.spage-number span.active:hover {
		background: #cc0000;
		color: #fff;
		border-color: #cc0000;
		z-index: 3;
	}
</style>
<body>
<!--头部-->
<header class="hytou">
	<div class="hytou1 after">
		<div class="hylogo">
			<a href="${s.base}/site/#"><img src="${webConfig.coverImage}" /> </a>
		</div>
		<ul class="hytouul after">
			<#list webNavigationList as webNavigation>
				<#if webNavigation.url?contains("?")>
					<li <#if webNavigation.id==navId>class="on"</#if>><a href="${webNavigation.url}&navId=${webNavigation.id}">${webNavigation.name}</a></li>
					<#else>
						<li <#if webNavigation.id==navId>class="on"</#if> ><a href="${webNavigation.url}?navId=${webNavigation.id}">${webNavigation.name}</a></li>
				</#if>
			</#list>
		</ul>
		<div class="hytou2 after">
			服务热线
			<span>${webConfig.telephone}</span>
		</div>
	</div>
</header>
<div class="newfm1  after">
	<div class="newinter after">
		<div class="newlogo">
			<a href="javascript:void(0);"><img style="height: 100%;width: 100%;" src="${webConfig.coverImage}" /> </a>
		</div>
		<div class="newselect" style="width:auto; min-width: 80px; ">
			<select onchange="changePage(this,'${navId}')">
				<#list hostCityList as city>
					<option  <#if city.id==cityId>selected</#if> value="${city.id}">${city.name}</option>
				</#list>
			</select>
		</div>
		<div class="after newseach">
			<div class="newseachm1">
				<input type="text" id="search" placeholder="输入商圈、小区或楼盘名开始找房" /><span id="searchBtn">搜新房</span>
			</div>
		</div>
	</div>
	<div class="newm1_a newinter">
		<a href="javascript:void(0);" data-id="" class="on">全部楼盘</a>
		<#list hostTypeList as hostType>
			<a href="javascript:void(0);" data-id="${hostType.id}">${hostType.name}</a>
		</#list>
	</div>
</div>
<div class="newfm2 newinter  after">
	<p class="newfm2_p1"><span>位置</span><span class="on">区域</span>  </p>
	<div class="newfm2_tab1">
		<div class="newfm2_tab2">
			<span class="on">不限</span>
			<#list hostAreaList as hostArea>
				<span data-id="${hostArea.id}">${hostArea.name}</span>
			</#list>
		</div>
	</div>
	<div class="newfm2_list jj_tab">
		<i>均价</i><span data-min="0" data-max="0" class="on">不限</span>
		<span  data-min="0" data-max="10000">10000以下</span>
		<span  data-min="10000" data-max="20000">10000-20000</span>
		<span  data-min="20000" data-max="30000">20000-30000</span>
		<span  data-min="30000" data-max="40000">30000-40000</span>
		<span  data-min="40000" data-max="50000">40000-50000</span>
		<span  data-min="50000" data-max="60000">50000-60000</span>
		<span  data-min="60000" data-max="0">60000以上</span>
	</div>
	<div class="newfm2_list hx_tab">
		<i>户型</i>
		<span data-rooms="0" class="on">不限</span>
		<span data-rooms="1">1室</span>
		<span data-rooms="2">2室 </span>
		<span data-rooms="3">3室</span>
		<span data-rooms="4">4室</span>
		<span data-rooms="5">5室</span>
		<span data-rooms="6">6室 </span>
		<span data-rooms="7">7室</span>
	</div>
	<div class="newfm2_list mj_tab">
		<i>面积</i>
		<span data-min="0" data-max="0" class="on">不限</span>
		<span data-min="0" data-max="50">50m2 以下</span>
		<span data-min="50" data-max="70">50-70m2</span>
		<span data-min="70" data-max="90">70-90m2</span>
		<span data-min="90" data-max="120">90-120m2</span>
		<span data-min="120" data-max="0">120m2以上</span>
	</div>
</div>

<div class="newfm3 newinter  after">
	<div class="newfm3_le">
		<p class="newfm3_p1"><span>默认排序</span><span>均价<img src="${s.base}/site/images/new4.png" /></span><span>开盘时间<img src="${s.base}/site/images/new4.png" /></span>  </p>
		<ul class="newfm3_ul" id="contentShow">
		</ul>
		<div id="myPage"></div>
	</div>
	<div class="newfm3_ri">
		<div class="newfm3_ri1">
			<p class="newfm3_p8">${currentCity.name}新房均价（元/平）</p>
			<p class="newfm3_p9">${currentCity.price}</p>
			<p class="newfm3_p8">昨日成交（套）</p>
			<p class="newfm3_p9">${currentCity.saleNum}</p>
		</div>
		<p class="newfm3_p10">热门楼盘</p>
		<ul class="newfm3_ul1">
			<#list hostItemList as hostItem>
				<#if hostItem_index lt 6>
				<li class="after">
					<a href="${s.base}/site/#">
						<div class="newfm3_img1">
							<img src="${hostItem.coverImage}" />
							<i><img src="${s.base}/site/images/in3.png" /> </i>
						</div>
						<div class="newfm3_text1">
							<p class="newfm3_p11">${hostItem.name}</p>
							<p class="newfm3_p12">${hostItem.minApartmentArea}-${hostItem.maxApartmentArea}m2</p>
							<p class="newfm3_p13"><span>${hostItem.price} </span>元/m2</p>
						</div>
					</a>
				</li>
				</#if>
			</#list>
		</ul>
	</div>

</div>







<!--底部-->
<footer>
	<div class="hyfoot0 ">
		<div class="hyfootm1 after">
			<div class="hyfoot_le">
				<p class="hyfoot_p1">快速通道</p>
				<p class="hyfoot_p2"><span class="on" data-id="1">城市楼盘</span><span data-id="2">城市小区</span><span data-id="3">城市房价</span><span data-id="4">热门房产网</span></p>
				<div class="hyfoot_tab">
					<ul class="hyfoot_ul" id="linkeShow">
					</ul>
				</div>
			</div>
			<div class="hyfoot_ri after">
				<div class="hyfoot_ri1">
					<p class="hyfoot_p1">联系我们</p>
					<#list webLinkerList as webLinker>
						<p class="hyfoot_p3"><a href="${webLinker.url}">${webLinker.name}</a> </p>
					</#list>
				</div>
				<div class="hyfoot_ri2">
					<p class="hyfoot_p4">服务声明邮箱: ${webConfig.email} </p>
					<p class="hyfoot_p5">服务热线: <span>${webConfig.telephone}</span> </p>
					<div class="hyfootewm after">
						<div>
							<img src="${s.base}/site/images/foot.jpg" />
							<p>关注微信</p>
						</div>
						<div>
							<img src="${s.base}/site/images/foot1.jpg" />
							<p>下载APP</p>
						</div>
					</div>
				</div>


			</div>
		</div>
	</div>
	<div class="hyfoot01">${webConfig.copyright}</div>
</footer>

<script>
	var navId='${navId}';
    var pageNum=0;
    var pageSize=10;
    var cityId='${cityId}';
    var hostType="";
    var areaId="";
    var minPrice=0;
    var maxPrice=0;
    var minApartmentArea=0;
    var maxApartmentArea=0;
    var rooms=0;

	//	房屋类型
	$('.newm1_a a').click(function(){
		$(this).addClass('on').siblings().removeClass('on');
        hostType=$(this).attr("data-id");
        pageNum=0;
        changeHost();
	})

	//	地点切换
	$('.newfm2_tab2 span').click(function(){
		$(this).addClass('on').siblings().removeClass('on');
        areaId=$(this).attr("data-id");
        pageNum=0;
        changeHost();
	})
    //均价切换
    $('.jj_tab span').click(function(){
        $(this).addClass('on').siblings().removeClass('on');
        minPrice=$(this).attr("data-min");
        maxPrice=$(this).attr("data-max");
        pageNum=0;
        changeHost();
    })
	//户型切换
    $('.hx_tab span').click(function(){
        $(this).addClass('on').siblings().removeClass('on');
        rooms=$(this).attr("data-rooms");
        pageNum=0;
        changeHost();
    })
    //面积切换
    $('.mj_tab span').click(function(){
        $(this).addClass('on').siblings().removeClass('on');
        minApartmentArea=$(this).attr("data-min");
        maxApartmentArea=$(this).attr("data-max");
        pageNum=0;
        changeHost();
    })
	//	条件切换
	$('.newfm2_list span').click(function(){
		$(this).addClass('on').siblings().removeClass('on');
	})

    $(document).ready(function(e) {
        $("#searchBtn").bind("click",function () {
            pageNum=0;
            changeHost();
        });
        changeHost();
        linke(1);
    });
    //友情链接 友情链接:1、城市楼盘，2、城市小区，3、城市房价、4、热门房产网,5、联系我们
    function linke(linkeType) {
        $("#linkeShow").html("");
        $.post("/webPc/linker", {'linkeType':linkeType}, function (result) {
            if (result.code === 0) {
                //操作成功
                if (result.data != null && result.data.length > 0) {
                    var str="";
                    for(var i=0;i<result.data.length;i++){
                        var obj=result.data[i];
                        if(i%7==0&&i==0){
                            str+="<li>"
                        }else if(i%7==0){
                            str+="</li><li>"
                        }
                        str+='<a href="'+obj.url+'" target="_blank">'+obj.name+'</a>';
                    }
                    str+="</li>";
                    $("#linkeShow").html(str);
                }
            } else {
                //操作失败
                console.log(result.msg);
            }
        }, "json");
    }

    //改变城市
    function changePage(obj,navId) {
        window.location.href="/webPc/list?navId="+navId+"&cityId="+$(obj).val();
    }

    //改变选择房屋类型
    function changeHost() {
        $("#contentShow").html("");
        var search=$("#search").val();
        $.post("/weChat/hostItem/page", {'pageNum':pageNum,'pageSize':pageSize,'name':search,'cityId':cityId,'hostType':hostType,'areaId':areaId
			,'minPrice':minPrice,'maxPrice':maxPrice,'rooms':rooms,'minApartmentArea':minApartmentArea,'maxApartmentArea':maxApartmentArea}, function (result) {
            if (result.code === 0) {
                //操作成功
                if (result.data != null && result.data.length > 0) {
                    result.data.forEach(function (item,key,mapObj) {
                        var str='<li class="after">'+
                            '<a href="/webPc/item?id='+item.id+'&navId='+navId+'">'+
                            '<div class="newfm3_img">'+
                            '<img src="'+item.coverImage+'" />'+
                            '<i><img src="${s.base}/site/images/in3.png" /> </i>'+
                            '</div>'+
                            '<div class="newfm3_text">'+
                            '<p class="newfm3_p3">'+item.name+'</p>'+
                            '<p class="newfm3_p4">'+item.cityName+' |   '+item.areaName+'  |   '+item.address+'</p>'+
                        '<p class="newfm3_p5">';
                        var c="";
                        if(item.tag!=null&&item.tag!=""&&item.tag!="null"){
                            var tags=item.tag.split(",");
                            for(var i=0;i<tags.length;i++){
                                c+='<span>'+tags[i]+'</span>';
                            }
                        }
                        if(c==""){
                            str+='<span></span>';
						}else{
                            str+=c;
						}
                           str+='<b>'+item.price+' <em>元/m2</em> </b><div style="clear:both"></div>'+
                            '</p>'+
                            '<p style="display: none;" class="newfm3_p6"><img src="${s.base}/site/images/new5.png" />于2019年5月20日-26公开认筹，房源建筑面积85-140m2<span>我要报备</span>  </p>'+
                        '<p class="newfm3_p7">'+item.minRooms+'-'+item.maxRooms+'室  |  '+item.minApartmentArea+'-'+item.maxApartmentArea+'m2 <span><img src="${s.base}/site/images/new6.png" /> 400-090-1083</span></p>'+
                            '</div>'+
                            '</a>'+
                            '</li>';
                        $("#contentShow").append(str);
                    });
                }
                $("#myPage").sPage({
                    page:pageNum,//当前页码，必填
                    total:result.count,//数据总条数，必填
                    pageSize:pageSize,//每页显示多少条数据，默认10条
                    showTotal:true,//是否显示总条数，默认关闭：false
                    totalTxt:"共{total}条",//数据总条数文字描述，{total}为占位符，默认"共{total}条"
                    noData: false,//没有数据时是否显示分页，默认false不显示，true显示第一页
                    showSkip:true,//是否显示跳页，默认关闭：false
                    showPN:true,//是否显示上下翻页，默认开启：true
                    prevPage:"上一页",//上翻页文字描述，默认“上一页”
                    nextPage:"下一页",//下翻页文字描述，默认“下一页”
                    backFun:function(page){
                        //点击分页按钮回调函数，返回当前页码
                        pageNum=page;
                        changeHost();
                    }
                });
            } else {
                //操作失败
                alert(result.msg);
            }
        }, "json");
    }
	//	底部切换
    $('.hyfoot_p2 span').click(function(){
        $(this).addClass('on').siblings().removeClass('on');
        var dataId=$(this).attr("data-id");
        linke(dataId);
    })

</script>
</body>
</html>
